-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] Update docstrings style #16427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[py] Update docstrings style #16427
Conversation
…itWebDriver and WPEWebDriver
…g checks and set pydocstyle convention to Google
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
@cgoldberg review pls |
PR Code Suggestions ✨Explore these optional code suggestions:
|
Thanks.. this looks good. But I don't understand the Ruff rules. This ignores all the docstring linting that you added:
Can you also fix the indentation of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove [tool.ruff.lint.per-file-ignores]
If this is going to fail everywhere, I'd suggest we don't add any rules until the docstrings are all fixed.
@cgoldberg The point is that these docstring formatting rules will keep the code up-to-date with Google formatting. If we don't ignore all Python files now, we'll need to make over 200 changes, which could lead to massive conflicts in other developers' branches.
|
…ing ignores and simplifying settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. thanks.
User description
🔗 Related Issues
related to #11442
💥 What does this PR do?
This pull request primarily updates docstring formatting in several service classes to follow the Google style, and adjusts the Python linting configuration to better handle docstring-related checks. The changes improve code consistency and maintainability by standardizing documentation and configuring the linter to align with the new style.
Docstring formatting updates:
ChromiumService
(py/selenium/webdriver/chromium/service.py
),Service
for Chrome (py/selenium/webdriver/chrome/service.py
),Service
for WebKitGTK (py/selenium/webdriver/webkitgtk/service.py
), andService
for WPEWebKit (py/selenium/webdriver/wpewebkit/service.py
) to use Google-styleArgs:
sections instead of the previous:param
format. [1] [2] [3] [4]Linting configuration changes:
pyproject.toml
to enable docstring checks (D
codes) in Ruff, but added extensive ignores for specific docstring rules and set the docstring convention to Google style, ensuring the linter matches the new docstring format.🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Documentation
Description
Standardized docstrings to Google style across Python service classes
Configured Ruff linter for Google-style docstring convention
Added extensive docstring rule ignores in linting configuration
Reformatted parameter documentation in Chrome, Chromium, WebKitGTK, and WPEWebKit services
Diagram Walkthrough
File Walkthrough
service.py
Convert Chrome Service docstring to Google style
py/selenium/webdriver/chrome/service.py
:param
format to Google-styleArgs:
sectionservice.py
Convert ChromiumService docstring to Google style
py/selenium/webdriver/chromium/service.py
:param
format to Google-styleArgs:
sectionservice.py
Convert WebKitGTK Service docstring to Google style
py/selenium/webdriver/webkitgtk/service.py
:param
format to Google-styleArgs:
sectionservice.py
Convert WPEWebKit Service docstring to Google style
py/selenium/webdriver/wpewebkit/service.py
:param
format to Google-styleArgs:
sectionpyproject.toml
Configure Ruff linter for Google-style docstrings
py/pyproject.toml
D
(docstring) checks to Ruff linter configuration